package com.zwj.rms.controller;


import com.zwj.rms.bo.MenuBo;
import com.zwj.rms.entity.SysMenuEntity;
import com.zwj.rms.service.SysMenuService;
import com.zwj.rms.vo.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 菜单表 前端控制器
 * </p>
 *
 * @author zwj
 * @since 2021-09-17
 */
@RestController
@RequestMapping("/menu")
public class SysMenuController {
    private final SysMenuService sysMenuService;

    public SysMenuController(SysMenuService sysMenuService) {
        this.sysMenuService = sysMenuService;
    }

    @ApiOperation(value = "条件查询菜单", notes = "条件查询菜单")
    @PostMapping("/selectMenu")
    public Result selectMenu(@RequestBody MenuBo menuBo) {
        return sysMenuService.selectMenu(menuBo);
    }

    @ApiOperation(value = "删除菜单", notes = "删除菜单")
    @PostMapping("/deleteMenu")
    public Result deleteMenu(@RequestBody MenuBo menuBo) {
        return sysMenuService.deleteMenu(menuBo);
    }

    @ApiOperation(value = "添加菜单", notes = "添加菜单")
    @PostMapping("/addMenu")
    public Result addMenu(@RequestBody SysMenuEntity sysMenuEntity) {
        return sysMenuService.addMenu(sysMenuEntity);
    }
    @ApiOperation(value = "修改菜单信息", notes = "修改菜单信息")
    @PostMapping("/updateMenu")
    public Result updateMenu(@RequestBody SysMenuEntity sysMenuEntity) {
        return sysMenuService.updateMenu(sysMenuEntity);
    }
}

